//
//  CeoZhuCell.m
//  JinChengYun
//
//  Created by 金橙云 on 2017/4/17.
//  Copyright © 2017年 金橙云. All rights reserved.
//

#define M_WID (([UIScreen mainScreen].bounds.size.width)/5)

#import "CeoZhuCell.h"

@implementation CeoZhuCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        
        _dayLab = [[UILabel alloc] init];
        _dayLab.textAlignment = NSTextAlignmentCenter;
        _dayLab.text = @"2017-09-11";
        _dayLab.textColor = [UIColor blackColor];
       // _dayLab.backgroundColor = [UIColor redColor];
        _dayLab.font = [UIFont systemFontOfSize:12];
        [self addSubview:_dayLab];
        [_dayLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(70, 20));
            make.left.equalTo(self.mas_left).offset(8);
            make.top.equalTo(self.mas_top).offset(10);
        }];

     
        
        _qiLab = [[UILabel alloc] init];
        _qiLab.textAlignment = NSTextAlignmentCenter;
        _qiLab.text = @"2期";
        _qiLab.textColor = [UIColor blackColor];
        //_qiLab.backgroundColor = [UIColor redColor];
        _qiLab.font = [UIFont systemFontOfSize:12];
        [self addSubview:_qiLab];
        [_qiLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(30, 20));
            //make.left.equalTo(_dayLab.mas_right).offset(8);
            make.top.equalTo(self.mas_top).offset(10);
            make.centerX.mas_equalTo(-M_WID);
        }];
        
        _louLab = [[UILabel alloc] init];
        _louLab.textAlignment = NSTextAlignmentCenter;
        _louLab.text = @"10号楼";
        _louLab.textColor = [UIColor blackColor];
       // _louLab.backgroundColor = [UIColor redColor];
        _louLab.font = [UIFont systemFontOfSize:12];
        [self addSubview:_louLab];
        [_louLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(45, 20));
            //make.left.equalTo(_qiLab.mas_right).offset(10);
            make.centerX.equalTo(self.mas_centerX);
            make.top.equalTo(self.mas_top).offset(10);
        }];


        _wuLab = [[UILabel alloc] init];
        _wuLab.textAlignment = NSTextAlignmentCenter;
        _wuLab.text = @"高层住宅";
        _wuLab.textColor = [UIColor blackColor];
        //_wuLab.backgroundColor = [UIColor redColor];
        _wuLab.font = [UIFont systemFontOfSize:12];
        [self addSubview:_wuLab];
        [_wuLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(55, 20));
            //make.left.equalTo(_louLab.mas_right).offset(8);
            make.top.equalTo(self.mas_top).offset(10);
             make.centerX.mas_equalTo(M_WID);
        }];

        
        _shenLab = [[UILabel alloc] init];
        _shenLab.textAlignment = NSTextAlignmentCenter;
        _shenLab.text = @"同意执行";
        _shenLab.textColor = [UIColor colorWithHexString:@"#006400"];
       // _shenLab.backgroundColor = [UIColor redColor];
        _shenLab.font = [UIFont systemFontOfSize:12];
        [self addSubview:_shenLab];
        [_shenLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(55, 20));
            make.right.equalTo(self.mas_right).offset(-10);
            make.top.equalTo(self.mas_top).offset(10);
        }];
        

        
        
        
        
        
        
    }
    return self;
}
-(void)setCeoZhuShenPiLieBiaoWithDateLab:(NSString *)_day withQiShu:(NSString *)_qi withLouHaoLab:(NSString *)_lou withTapeLab:(NSString *)_tape withPiTape:(NSString *)_pi withShenPiLab:(NSString *)_shen
{
    _dayLab.text = _day;
    _qiLab.text = _qi;
    _louLab.text = _lou;
    _wuLab.text = _tape;
    if ([_pi isEqualToString:@"1"])
    {
        _shenLab.text = _shen;
        _shenLab.textColor = [UIColor blackColor];
    }
    else if ([_pi isEqualToString:@"2"])
    {
        _shenLab.text = _shen;
        
        _shenLab.textColor = [UIColor colorWithHexString:@"#006400"];

    }
    else
    {
        _shenLab.text = _shen;
        _shenLab.textColor = [UIColor redColor];

    }
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
